import datetime
from apps.extensions import db
class Tag(db.Model):
    """标签模型"""
    __tablename__ = 'cms_tags'

    id = db.Column(db.Integer, primary_key=True, comment='标签ID', autoincrement=True)
    title = db.Column(db.String(100), unique=True,nullable=False, comment='标签名称')
    alias = db.Column(db.String(100), unique=True, nullable=False, comment='标签别名')
    desc = db.Column(db.Text, comment='标签描述')
    count = db.Column(db.Integer, default=0, comment='使用次数')
    deleted = db.Column(db.Boolean, default=False, comment='是否删除')
    created_at = db.Column(db.DateTime, default=datetime.datetime.now, comment='创建时间')
    updated_at = db.Column(db.DateTime, default=datetime.datetime.now, onupdate=datetime.datetime.now, comment='更新时间')